<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

    <h1>首页</h1>

    <h3>测试常规请求</h3>
    <a th:href="@{/exception/arithmetic}">抛出数学异常</a><br/>
    <a th:href="@{/exception/null/pointer}">抛出空指针异常</a><br/>

    <h3>测试 Ajax 请求</h3>
    <div id="btnDiv">
        <button type="submit" @click="youClickMe">抛出数组下标越界异常[Ajax]</button>
    </div>
    <a th:href="@{/exception/array/out/of/bound/common}">抛出空指针异常[普通]</a><br/>

</body>
<script type="text/javascript" th:src="@{/script/vue.js}"></script>
<script type="text/javascript" th:src="@{/script/axios.min.js}"></script>
<script type="text/javascript">

    new Vue({
        "el":"#btnDiv",
        "methods":{
            "youClickMe":function () {
                axios({
                    "url":"[[@{/exception/array/out/of/bound/ajax}]]",
                    "method":"post"
                }).then(function (response) {
                    console.log(response);
                    alert(response.data);
                }).catch(function (response) {
                    console.log(response);
                })
            }
        }
    });

</script>
</html>